<script lang="ts" setup>
import { getListByConditions, urls } from '@/index';
import type { User } from '@/index.d';
import { useRequest } from 'vue-request';

const props = defineProps({
  disabledUsername: {
    type: String
  }
});

const getUsersPromise = () => getListByConditions<User>(urls.user, {});

const { data } = useRequest(getUsersPromise);
</script>
<template>
  <el-option
    v-for="item in data"
    :key="item.id"
    :label="((item.workNo as string) + ' - ' + item.name) as string"
    :value="item.username as string"
    v-bind="$attrs"
    :disabled="item.username === props.disabledUsername"
  />
</template>
